package pe.gob.onpe.ejb.id;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CronogramaElectoralId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class CronogramaElectoralId implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -5625188870444261063L;
	private Long actividadElectoralId;
	private Long procesoElectoralId;

	// Constructors

	/** default constructor */
	public CronogramaElectoralId() {
	}

	/** full constructor */
	public CronogramaElectoralId(Long actividadElectoralId,
			Long procesoElectoralId) {
		this.actividadElectoralId = actividadElectoralId;
		this.procesoElectoralId = procesoElectoralId;
	}

	// Property accessors

	@Column(name = "ACTIVIDAD_ELECTORAL_ID", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getActividadElectoralId() {
		return this.actividadElectoralId;
	}

	public void setActividadElectoralId(Long actividadElectoralId) {
		this.actividadElectoralId = actividadElectoralId;
	}

	@Column(name = "PROCESO_ELECTORAL_ID", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getProcesoElectoralId() {
		return this.procesoElectoralId;
	}

	public void setProcesoElectoralId(Long procesoElectoralId) {
		this.procesoElectoralId = procesoElectoralId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CronogramaElectoralId))
			return false;
		CronogramaElectoralId castOther = (CronogramaElectoralId) other;

		return ((this.getActividadElectoralId() == castOther
				.getActividadElectoralId()) || (this.getActividadElectoralId() != null
				&& castOther.getActividadElectoralId() != null && this
				.getActividadElectoralId().equals(
						castOther.getActividadElectoralId())))
				&& ((this.getProcesoElectoralId() == castOther
						.getProcesoElectoralId()) || (this
						.getProcesoElectoralId() != null
						&& castOther.getProcesoElectoralId() != null && this
						.getProcesoElectoralId().equals(
								castOther.getProcesoElectoralId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getActividadElectoralId() == null ? 0 : this
						.getActividadElectoralId().hashCode());
		result = 37
				* result
				+ (getProcesoElectoralId() == null ? 0 : this
						.getProcesoElectoralId().hashCode());
		return result;
	}

}